package com.ruoyi.mdm.domain.dto;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.mdm.domain.MaterialCategory;
import lombok.Data;

/**
 * @description 物料类别对象DTO
 */
@Data
public class MaterialCategoryDTO {

	/** 类别编码 */
    @Excel(name = "类别编码")
    private String categoryCode;

    /** 类别名称 */
    @Excel(name = "类别名称")
    private String categoryName;

    /** 类别英文名称 */
    @Excel(name = "类别英文名称")
    private String categoryNameEn;

    /** 类别描述 */
    @Excel(name = "类别描述")
    private String categoryDesc;

	@Excel(name = "父类编码")
    private String parentCode;

    private String ancestorList;

    private Long parentId;
    private Long tableId;

    public MaterialCategory toPO() {
        MaterialCategory materialCategory = new MaterialCategory();
        materialCategory.setCategoryCode(this.getCategoryCode());
        materialCategory.setCategoryName(this.getCategoryName());
        materialCategory.setCategoryNameEn(this.getCategoryNameEn());
        materialCategory.setCategoryDesc(this.getCategoryDesc());
        materialCategory.setParentId(this.getParentId());
        materialCategory.setTableId(this.getTableId());
        materialCategory.setStatus("0");
        materialCategory.setDelFlag("0");
        materialCategory.setSortNo(1);
        return materialCategory;
    }
}
